<tr class="main-row">
  {{#if bulkActions}}
    <td valign="middle" class="row-check" style="padding-top: 2px;">
      {{check-box nodeId=model.id}}
    </td>
  {{/if}}

  <td data-title="{{dt.state}}" class="clip">
    {{badge-state model=model}}
  </td>
  <td data-title="{{dt.name}}" class="clip">
    {{#tooltip-element
        type="tooltip-basic"
        model=model.name
        tooltipTemplate='tooltip-static'
        aria-describedby="tooltip-base"
        tooltipFor="tooltipLink"
        placement="top"
    }}
      {{model.name}}
    {{/tooltip-element}}
  </td>
  <td data-title="{{dt.target}}" class="clip">
    <div> {{model.displayTargetType}} </div>
    {{#if (eq model.targetType 'nodeSelector')}}
      {{#if (eq selectorList.length 1)}}
          <span
            class="badge badge-xs bg-info"
            style="color:#ecf0f1!important;border-radius:2px;"
          >
            {{get selectorList 'firstObject'}}
          </span>
      {{else if (gt selectorList.length 1)}}
        {{#tooltip-element
            type="tooltip-basic"
            model=selectorListTip
            tooltipTemplate='tooltip-static'
            aria-describedby="tooltip-base"
            tooltipFor="tooltipLink"
        }}
          <div class="text-link"> {{selectorList.length}} {{t 'alertPage.items'}} </div>
        {{/tooltip-element}}
      {{else}}
        {{t 'alertPage.na'}}
      {{/if}}
    {{else if (eq model.targetType 'node')}}
      <div class="text-muted text-small">
        {{model.nodeName}}
      </div>
    {{else if (eq model.targetType 'systemService')}}
      <div class="text-muted text-small">
        {{model.targetSystemService.condition}}
      </div>
    {{else if (eq model.targetType 'event')}}
      <div class="text-muted text-small">
        <span class="text-capicalize">{{model.resourceKind}}</span> {{t 'alertPage.targetTypes.event'}}
      </div>
    {{/if}}
  </td>

  <td data-title="{{dt.condition}}" class="clip">
    {{#if (eq model.targetType 'metric')}}
      {{#tooltip-element
          type="tooltip-basic"
          model=model.metricRule.expression
          tooltipTemplate='tooltip-static'
          aria-describedby="tooltip-base"
          tooltipFor="tooltipLink"
          placement="top"
      }}
        {{model.displayCondition}}
      {{/tooltip-element}}
    {{else}}
      {{model.displayCondition}}
    {{/if}}
  </td>

  <td data-title="{{dt.recipients}}" class="clip">
    {{#if alertGroup.recipients.length}}
      {{#if (eq alertGroup.recipients.length 1)}}
        <div class="clip">
          {{alertGroup.displayRecipient}}
        </div>
        {{else if (gt alertGroup.recipients.length 1)}}
          {{#tooltip-element
               type="tooltip-basic"
               model=recipientsTip
               tooltipTemplate='tooltip-static'
               aria-describedby="tooltip-base"
               tooltipFor="tooltipLink"
          }}
              <div class="text-link">{{alertGroup.displayRecipient}}</div>
          {{/tooltip-element}}
        {{/if}}
      {{else}}
        {{t 'alertPage.na'}}
      {{/if}}
   </td>

  <td data-title="{{t 'generic.actions'}}" class="actions">
    {{action-menu model=model}}
  </td>
</tr>